package aquarium.items;

import java.awt.Image;
import java.awt.Point;
import java.util.Collection;

import aquarium.gui.Aquarium;
import aquarium.time.TManager;
import aquarium.util.RandomNumber;

public abstract class Fish extends MobileItem {

	private boolean _piscivore;
	private boolean _eatable;    //comestible
	private boolean _dead;
	private Sex _sex;
	private int _fecond;
	
	public Fish(Image image, 
			Point position, 
			int size,
			boolean destructible, 
			boolean letal, 
			long move_delay,
			long change_target_delay,
			Point target,
			boolean piscivore,
			boolean eatable,
			Sex sex,
			boolean visitor,
			TManager tmanager) {
		super(image, position, size, destructible, letal, move_delay, change_target_delay, target, visitor, tmanager);
		this._piscivore = piscivore;
		this._eatable = eatable;
		this._sex = sex;
		this._fecond = 0;
	}

	public boolean is_piscivore() {
		return _piscivore;
	}

	public boolean is_eatable() {
		return _eatable;
	}
	
	public boolean is_dead() {
		return _dead;
	}
	
	public Sex get_sex(){
		return _sex;
	}
	
	public int get_fecond(){
		return _fecond;
	}
	
	public void set_fecond(int fecond){
		_fecond = fecond;
	}
	
	public void newTarget(Collection<AquariumItem> items){
		Point pt = new Point(RandomNumber.randomPoint(0, Aquarium.SIZE_AQUA_X-Fish.getMaxWidth(), 0, Aquarium.SIZE_AQUA_Y-Fish.getMaxWidth()));
		get_target().setLocation(pt); 
	}
}
